//
//  DLQQShareManager.h
//  DGGSharePayKit
//
//  Created by 伍明鹏 on 2020/4/13.
//

#import <Foundation/Foundation.h>
#import <TencentOpenAPI/QQApiInterfaceObject.h>

typedef NS_ENUM(NSUInteger,QQShareCallBackStatusType){
    QQShareCallBackStatusTypeSuccess = 0,//分享成功
    QQShareCallBackStatusTypeCancel = 1,//分享取消
    QQShareCallBackStatusTypeFail = 2,//分享失败
};

@protocol QQSharedMesaageDelegate<NSObject>
/**
 * 分享结果回调  不带分享状态，需要自己从response解析
 */
- (void)dl_sharedMessageCallBack:(BOOL)success responseData:(SendMessageToQQResp *)response;
/**
* 分享结果回调 带分享状态
*/
- (void)dl_sharedMessageCallBackStatusType:(QQShareCallBackStatusType)callBackStatusType responseData:(SendMessageToQQResp *)response;
@end

@interface DLQQShareManager : NSObject

@property (nonatomic, weak) id<QQSharedMesaageDelegate> delegate;

///分享回调
@property (nonatomic, copy) void(^dl_shareMessageCallBack)(QQShareCallBackStatusType callBackStatusType,SendMessageToQQResp*response);

+ (instancetype)sharedInstance;

//-------------------------通用---------------

/**
handle open url
*/
- (BOOL)dl_handleOpenURL:(NSURL *)theURL;

/**
 handle open url
 */
- (BOOL)dl_handleOpenURL:(NSURL *)theURL universalLink:(NSUserActivity *)userActivity;

//-------------------qq分享--------------
/**
 QQ分享
 @param url 视频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param previewImageURL 分享预览内容图像url
 */
- (void)dl_shareWithMediaURL:(NSString *)url
                description:(NSString *)description
                title:(NSString *)title
      previewImageURL:(NSURL *)previewImageURL;

/**
 QQ分享
 @param url 视频内容的目标URL
 @param title 分享内容的标题
 @param description 分享内容的描述
 @param previewImageData 分享预览内容图像
 */
- (void)dl_shareWithMediaURL:(NSString *)url
                description:(NSString *)description
                title:(NSString *)title
      previewImageData:(NSData *)previewImageData;

/**
 QQ分享(图片)
@param data 数据内容
*/
- (void)dl_shareImageWithData:(NSData*)data;

#pragma mark - QQ授权登录
- (void)dl_qqAuthLoginWithappId:(NSString *)appId universalLink:(NSString *)universalLink;
@end

